package com.dhl.mediator;

import com.dhl.mediator.smarthouse.Alarm;
import com.dhl.mediator.smarthouse.CoffeeMachine;
import com.dhl.mediator.smarthouse.TV;

/**
 * @title: Client
 * @Author danghailiang
 * @Date: 2022/8/22 11:14
 * @Version 1.0
 */
public class Client {
    public static void main(String[] args) {
        // 创建协调者
        Mediator mediator = new Mediator();
        /**
         * 将所使用到的被协调者进行创建
         */
        Alarm alarm = new Alarm("设置闹钟", mediator);
        CoffeeMachine coffeeMachine = new CoffeeMachine("咖啡机", mediator);
        TV tv = new TV("TV", mediator);
        // 发送协调信息
        alarm.sndAlarm(0);
        alarm.sndAlarm(1);
    }
}
